package com.xk857.simpleeffect.domain.entity;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;


public class Business implements Serializable {

    private static final long serialVersionUID = 1L;

    private Long id;

    private String title;

    private String startTime;

    private String endTime;

    private List<Integer> remindTime;

    private String remark;

    private List<Integer> createTime;

    private Boolean status;

    private Long cid;

    private Boolean deleted;

    private String icon;

    private List<Integer> finishTime;

    private Integer projectId;
    private String projectName;

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public LocalDateTime getRemindTime() {
        if (remindTime == null) {
            return null;
        }
        if (remindTime.size() == 5) {
            return LocalDateTime.of(remindTime.get(0), remindTime.get(1), remindTime.get(2), remindTime.get(3), remindTime.get(4), 0);
        }
        return LocalDateTime.of(remindTime.get(0), remindTime.get(1), remindTime.get(2), remindTime.get(3), remindTime.get(4), remindTime.get(5));
    }

    public void setRemindTime(List<Integer> remindTime) {
        this.remindTime = remindTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public LocalDateTime getCreateTime() {
        if (createTime.size() == 5) {
            return LocalDateTime.of(createTime.get(0), createTime.get(1), createTime.get(2), createTime.get(3), createTime.get(4), 0);
        }
        return LocalDateTime.of(createTime.get(0), createTime.get(1), createTime.get(2), createTime.get(3), createTime.get(4), createTime.get(5));
    }

    public void setCreateTime(List<Integer> createTime) {
        this.createTime = createTime;
    }

    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    public Long getCid() {
        return cid;
    }

    public void setCid(Long cid) {
        this.cid = cid;
    }

    public Boolean getDeleted() {
        return deleted;
    }

    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public LocalDateTime getFinishTime() {
        if (finishTime == null) {
            return LocalDateTime.now();
        }
        if (finishTime.size() == 5) {
            return LocalDateTime.of(finishTime.get(0), finishTime.get(1), finishTime.get(2), finishTime.get(3), finishTime.get(4), 0);
        }
        return LocalDateTime.of(finishTime.get(0), finishTime.get(1), finishTime.get(2), finishTime.get(3), finishTime.get(4), finishTime.get(5));
    }

    public void setFinishTime(List<Integer> finishTime) {
        this.finishTime = finishTime;
    }

    public Integer getProjectId() {
        return projectId;
    }

    public void setProjectId(Integer projectId) {
        this.projectId = projectId;
    }

    @Override
    public String toString() {
        return "Business{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", startTime='" + getStartTime() + '\'' +
                ", endTime='" + getEndTime() + '\'' +
                ", remindTime=" + getRemindTime() +
                ", remark='" + remark + '\'' +
                ", createTime=" + getCreateTime() +
                ", status=" + status +
                ", cid=" + cid +
                ", deleted=" + deleted +
                ", icon='" + icon + '\'' +
                ", finishTime=" + getFinishTime() +
                ", projectId=" + projectId +
                ", projectName='" + projectName + '\'' +
                '}';
    }
}